// highlightDirective.js
import Hljs from 'highlight.js';
// import 'highlight.js/styles/default.css'; // 选择你喜欢的样式
// import 'highlight.js/styles/monokai.css';
import 'highlight.js/styles/atom-one-dark.css';
export default {
  beforeMount(el, binding, vnode, prevVnode) {
    const blocks = el.querySelectorAll('pre code');
    blocks.forEach((block) => {
      Hljs.highlightBlock(block);
    });
  },
  updated(el, binding, vnode, prevVnode) {
    const blocks = el.querySelectorAll('pre code');
    blocks.forEach((block) => {
      Hljs.highlightBlock(block);
    });
  },
};
